<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ include file="/pages/common/header.jsp"%>
</head>
<body>
	<div class="contentBody contentborder">
		<div class="tab-pane" id="tabPane">
			<div id="message">${message }</div>
			<div class="tab-page">
				 <h1 class="tab">选择公司</h1>
 				 <div class="contentborder">
                	 <jdf:form bean="request" scope="request">
						<form action="${dynamicDomain}/company/select?ajax=1" method="post">
							 <table class="inputTable">
			                 	<tr>
									<td nowrap class="label">
										<label for="search_LIKES_name">公司名称：</label>
									</td>
									<td class="content">
										<input type="text" name="search_LIKES_name" />
									</td>
									<td nowrap class="label cancelBorderLeft">
										<label for="search_LIKES_address">地址：</label>
									</td>
									<td class="content">
										<input type="text" name="search_LIKES_address" />
									</td>
			                 	</tr>
			                 	<tr>
                                	<td class="bottomLabel" nowrap colspan="4">
                                		<div class="right">
											<button type="button" onclick="javascript:clearSelect()">清除</button>
											<button type="submit">查询</button>
                                		</div>
									</td>
			                 </table>
			            </form>
			        </jdf:form>
				</div>
				<div class="contentborder listArea">
					<div class="toolBar">
					</div>
					<div id="tableDiv">
						<jdf:table items="items" var="currentRowObject" retrieveRowsCallback="limit" filterRowsCallback="limit" sortRowsCallback="limit" action="select?ajax=1">
							<jdf:export view="csv" fileName="客户.csv" tooltip="Export CSV" imageName="csv" />
							<jdf:export view="xls" fileName="客户.xls" tooltip="Export EXCEL" imageName="xls" />
							<jdf:row>
								<jdf:column property="objectId" title="编号" style="width: 10%">
                                    ${currentRowObject.no}
                                </jdf:column>
								<jdf:column property="name" title="客户名称" style="width: 10%" />
								<jdf:column property="linkPerson" title="联系人" style="width: 10%"/>
								<jdf:column property="linkTelephone" title="联系电话" style="width: 10%" />
								<jdf:column property="address" title="地址" style="width: 40%" />
								<jdf:column alias="操作" sortable="false" viewsAllowed="html" style="width: 10%">
									<a href="javascript:select(${currentRowObject.objectId},'${currentRowObject.name}')" class="button">选择</a>
								</jdf:column>
							</jdf:row>
						</jdf:table>
					</div>
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript">
		function clearSelect(){
	        parent.$("#companyId").val("");
	        parent.$("#companyName").val("");
	        parent.jQuery.fn.colorbox.close();
	    }
	
		function select(companyId,name){
			parent.$("#companyId").val(companyId);
			parent.$("#companyName").val(name);
			parent.jQuery.fn.colorbox.close();
		}
	</script>
</body>
</html>